package edu.xmut.kakamusic.adapter.video;


import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import java.util.List;

import edu.xmut.kakamusic.R;
import edu.xmut.kakamusic.bean.entity.Video;
import edu.xmut.kakamusic.utils.RequestUtils;

public class VideoAdapter extends BaseQuickAdapter<Video, BaseViewHolder> {
    public VideoAdapter(@Nullable List<Video> data) {
        super(R.layout.item_video, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, Video video) {
        Glide.with(baseViewHolder.itemView)
                .load(RequestUtils.BASE_URL + video.getImg())
                .into((ImageView) baseViewHolder.getView(R.id.iv_item_video));
    }
}
